/**
 * 
 */
package com.cssnb.nbzj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cssnb.commons.domain.Page;
import com.cssnb.commons.domain.PageRequest;
import com.cssnb.nbzj.dao.YyginfoMapper;
import com.cssnb.nbzj.entity.Yyginfo;

/**
 * @author xuning email:xuningnb@163.com
 * @version creation time:2012-5-28下午2:59:22 类说明：
 * 
 */
@Service
public class YgManager {

	@Autowired
	private YyginfoMapper yyginfoMapper;

	// @Autowired
	// private YyginfoDAO yyginfoDAO;
	public List<Yyginfo> getYyginfoList(){
		return yyginfoMapper.getYyginfoList();
	}
	public Page<Yyginfo> findAll(PageRequest pageRequest){
		return yyginfoMapper.getYyginfoList(pageRequest);
	}
	public Page<Yyginfo> findByPage(PageRequest pageRequest){
		// return yyginfoMapper.listPage(pageRequest.getFilters(),pageRequest);
		int count = yyginfoMapper.count();
		Page<Yyginfo> result = new Page<Yyginfo>(pageRequest, count);
		if(count > 0){
			List<Yyginfo> data = yyginfoMapper.getYyginfoList();
			result.setResult(data);
		}
		return result;
	}
}
